<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../include/easyui.jsp" %>
<link href="/icon/sys_icon.css" type="text/css" rel="stylesheet"/>
<title>通信工程项目管理系统</title>
<style type="text/css">
	.tree-node-selected { background: #FBEC88;} 
	.accordion .accordion-header-selected {background: #E0ECFF;}
</style>
<link rel="stylesheet" type="text/css" href="${path}/plug-in/layui/css/layui.css"/>
<script type="text/javascript" src="${path}/include/console.js?a=ddd"></script>
<script type="text/javascript" src="${path}/plug-in/layui/layui.all.js"></script>
<script>
layui.use(['element','util'], function(){
	 var $ = layui.jquery;
	 var util = layui.util;
	 var fn = {
			 /*时间计数器*/
     		reloadTime: function(){
     			var endTime = new Date(2199,1,1).getTime() //假设为结束日期
     			  ,serverTime = new Date().getTime(); //假设为当前服务器时间，这里采用的是本地时间，实际使用一般是取服务端的
    			  	util.countdown(endTime, serverTime, function(date, serverTime, timer){
    			  		$("#timeshow").text('系统时间：'+ util.toDateString(new Date(), 'yyyy-MM-dd HH:mm:ss'));
    			  	});
     		},
     		asyData: function(){
    			$.getJSON('/console/project/rewrite/count', {}, function(result){
					if(result.flag){
						var data  = result.data;
						$("#contractCount").text(data.contractCount);
						$("#projectCount").text(data.projectCount);
						$("#incomeCount").text(data.incomeCount);
						$("#invoiceCount").text(data.invoiceCount);
						$("#expenseCount").text(data.expenseCount);
					}
				});
    		},
     		reloadCount:function(){
     			var _this = this;
     			_this.asyData();
	     		/* 60秒定时更新统计数据*/
     			/*var timer = setInterval(function(){
     				_this.asyData();
     			},60000);*/
     		},
     		start:function(){
     			this.reloadTime();
     			this.reloadCount();
     		}
	 };
	 fn.start();
});
	

	$(function(){
		var sessionMenu = jQuery.parseJSON('${SESSION_MENU}') || {} ;
		var _menus = { "menus": sessionMenu.rows || []};
		consoleFn.initLeftMenu(_menus);
		$.messager.show({ title : '提示', msg : "欢迎您登录系统！" }); 
		
		$("#b_1").on("click",function(){
			layer.confirm('您确定想要重新登录吗？', {icon: 3, title:'温馨提示'}, function(index){
				window.location.href="/console/logout" ;
				layer.close(index);
			});
		});
		
		$("#updatePwd").click(function(){
			layer.open({
					  type: 2,
					  title :"修改密码",
					  area: ['400px', '280px'],
					  btn:['提交'],
					  yes: function(index, layero){
						  var iframeWin = window[layero.find('iframe')[0]['name']];
						  iframeWin.fn.onAfterSubmitForm=function(){
							//修改成功后重新登录
							window.location.href="/console/logout" ;
							layer.close(index);
						  }
						  iframeWin.fn.submitForm();
					  },
					  content: ["/console/user/rewrite/update", 'no']
					});
		});
	});
</script>
<style type="text/css">
	.grid-demo {
    padding: 10px;
    line-height: 50px;
    text-align: center;
    background-color: #79C48C;
    color: #fff;
}
	.grid-demo-bg1 {
    background-color: #63BA79;
}
</style>
</head>
<body class="easyui-layout">
	<div data-options="region:'south',border:false" style="height:30px;padding:5px;">
		<center>版权所有：武汉江浙智能科技有限公司&nbsp;&nbsp;&nbsp;版本号：V1.0.56</center>
	</div>
	<div data-options="region:'north',border:false" style="height:45px;background-color: #E0ECFF;">
		<div style="float: left;height: 45px;width: 45px;">
			<img src="/images/Logo_xx.jpg"  style="float: left;height: 44px;width: 44px;line-height: 44px;" />
		</div>
		<div style="float: left;height: 45px;line-height: 45px;font-weight:800;font-size: 20px;padding-left: 5px;">通信工程项目管理系统V1.0</div> 
		<div style="float:right;margin-top: 10px;margin-right: 15px;">
			<a href="#" class="easyui-linkbutton" plain="true"  id="b_2">欢迎您，${SESSION_USER.user.nickName}</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-config" plain="true" id="updatePwd">修改密码</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true" id="b_1">重新登录</a>
		</div>
	</div>
	<div data-options="region:'west',split:true,title:'菜单导航'" style="width:200px;">
		<div id="easyui-accordion" data-options="fit:true,border:false,split:true"></div>
	</div>
	<div data-options="region:'center'">
		<div id="easyui-tabs" class="easyui-tabs" data-options="fit:true,border:false,plain:true">
			<div title="首页" style="padding:10px">
			
			<blockquote class="layui-elem-quote" style="margin-top: 10px;">
			  <div id="timeshow">系统时间：2017-12-24 20:49:59</div>
			</blockquote>
			
			<blockquote class="layui-elem-quote">
	       		竭诚为您服务，最优的选择，最好的体验，始终坚信客户至上！
	      	</blockquote>
			
				
			<fieldset class="layui-elem-field layui-field-title">
			    	<legend>统计详情</legend>
			</fieldset>
			
			<!-- 统计详情 -->
			<div id="admin">
			
			<button class="layui-btn">立项总数<span class="layui-badge" id="projectCount" >0</span></button>
			<button class="layui-btn">合同总数<span class="layui-badge" id="contractCount" >0</span></button>
			<button class="layui-btn">开票总数<span class="layui-badge" id="invoiceCount" >0</span></button>
			<button class="layui-btn">今收入总数<span class="layui-badge" id="incomeCount" >0</span></button>
			<button class="layui-btn">支出总数<span class="layui-badge" id="expenseCount" >0</span></button>
			</div>

	      <!-- 平台服务 -->
	      <fieldset class="layui-elem-field layui-field-title">
		    <legend>平台服务</legend>
		  </fieldset>
		  <blockquote class="layui-elem-quote">
       		 <p>QQ：290147246</p>
       		 <hr>
       		 <p>电话：18696168103</p>
	      </blockquote>
		</div>
	</div>
</body>
</html>